package com.pearadmin.modules.blog.service.impl;

import com.pearadmin.modules.blog.domain.Classification;
import com.pearadmin.modules.blog.mapper.ClassificationMapper;
import com.pearadmin.modules.blog.service.IClassificationService;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.pearadmin.common.web.domain.request.PageDomain;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service("classificationService")
public class ClassificationServiceImpl implements IClassificationService {



    @Resource
    ClassificationMapper classificationMapper;

    @Override
    public List<Classification> selectList(Classification param) {
        return classificationMapper.selectList(param);
    }

    @Override
    public PageInfo<Classification> page(Classification param, PageDomain pageDomain) {
        PageHelper.startPage(pageDomain.getPage(),pageDomain.getLimit());
        List<Classification> classifications = classificationMapper.selectList(param);
        return new PageInfo<>(classifications);
    }

    @Override
    public Integer insert(Classification classification) {
        return classificationMapper.insert(classification);
    }

    @Override
    public Classification selectById(Integer id) {
        return classificationMapper.selectById(id);
    }

    @Override
    public Integer updateById(Classification classification) {
        return classificationMapper.updateById(classification);
    }

    @Override
    public Integer deleteById(Integer id) {
        return classificationMapper.deleteById(id);
    }

    @Override
    public Integer deleteByIds(Object[] ids) {
        return classificationMapper.deleteByIds(ids);
    }

}
